﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Bot.Domain.Enum;
using Comm100.Domain.Entity;
using Comm100.Framework.Domain.Entity;

namespace Bot.Domain.Entities
{
    [Table("t_IA_Chatbot")]
    public class Chatbot : IMultiSite, ISoftDelete
    {
        [Key]             
        public Guid Id { get; set; }
        public int SiteId { get; set; }
        public string Language { get; set; }
        public EnumBotType EngineType { get; set; }
        public Guid? AvatarId { get; set; }
        public string DialogFlowProjectId { get; set; }
        public string Name { get; set; }
        public Guid? ThirdPartyWebhookId { get; set; }
        public bool IsTrained { get; set; }
        public string MessageWhenNotHelpful { get; set; }
        public bool? IfIncludeContactAgentOptionWhenNotHelpful { get; set; }
        public string MessageWhenProvidingPossibleAnswer { get; set; }
        public int? ConsecutiveTimesOfPossibleAnswers { get; set; }
        public string MessageAfterVisitorChooseToContactAgent { get; set; }
        public string ContactAgentButtonTextWhenOnline { get; set; }
        public string ContactAgentButtonTextWhenOffline { get; set; }
        public string FormSubmitButtonText { get; set; }
        public string FormCancelButtonText { get; set; }
        public string FormConfirmButtonText { get; set; }
        public decimal? HighConfidenceScore { get; set; }
        public decimal? NoAnswerScore { get; set; }
        public DateTime LastUpdatedTime { get; set; }
        public string OwnBotConfig { get; set; }
        public bool IsDeleted { get; set; }

        [NotMapped]
        public virtual Image Avatar { get; set; }
        [NotMapped]
        public virtual ICollection<GreetingMessageInChannel> GreetingMessageInChannels { get; set; }
        [NotMapped]
        public virtual ICollection<NoAnswerMessageInChannel> NoAnswerMessageInChannels { get; set; }
        [NotMapped]
        public virtual ICollection<MessageAfterSeveralConsecutivePossibleAnswersInChannel> MessageAfterSeveralConsecutivePossibleAnswersInChannels { get; set; }
        [NotMapped]
        public virtual Webhook ThirdPartyWebhook { get; set; }
        [NotMapped]
        public ICollection<string> EnabledChannels { get; set; }
    }
}
